import os

def img_download():
    path = "./usage_src_img"
    if(not os.path.exists(path)):
        os.makedirs(path)
    import requests
    headers = {
        "Upgrade-Insecure-Requests": "1",
        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"

    }
    url = "http://jwmis.hnie.edu.cn/jwweb/sys/ValidateCode.aspx"
    for i in range(0, 5):
        with open("{}/{}.jpg".format(path,i), "wb") as f:
            print("{} pic downloading...".format(i))
            f.write(requests.get(url, headers=headers).content)


if(__name__ == "__main__"):
    img_download()